<?php
/*
 * Created on 24 janv. 2009
 * Created by Ludovic Reenaers
 * lreenaers@hotmail.com
 */

class DAOFactory{
	protected $pdo;

	protected $CategorieDAO=null;
	protected $CategorieInfoDAO=null;
	protected $DocumentDAO=null;
	protected $DocumentInfoDAO=null;
	protected $EntiteDAO=null;
	protected $LangueDAO=null;
	protected $LangueLabelDAO=null;
	protected $ListeDAO=null;
	protected $ListeValueDAO=null;
	protected $ProfileDAO=null;
	protected $ProprieteDAO=null;
	protected $ProprieteInfoDAO=null;
	protected $ProprieteValueDAO=null;
	protected $TokenDAO=null;
	protected $TokenPackDAO=null;
	protected $TranslationDAO=null;
	protected $TypeDocumentDAO=null;
	protected $TypeEntiteDAO=null;
	protected $TypeEntiteInfoDAO=null;
	protected $TypeProprieteDAO=null;
	protected $UserDAO=null;



	function __construct(){
			
		$user = "root";
		$pws = "makemyday";
			
		$this->pdo=new PDO($_SESSION['config']->db,$user,$pws);
		$this->pdo->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);


	}
	function getTypeProprieteDAO(){
		if($this->TypeProprieteDAO==null){

			$this->TypeProprieteDAO = new TypeProprieteDAO($this->pdo,$this);
		}
		return $this->TypeProprieteDAO;
	}
	function getTypeDocumentDAO(){
		if($this->TypeDocumentDAO==null){

			$this->TypeDocumentDAO = new TypeDocumentDAO($this->pdo,$this);
		}
		return $this->TypeDocumentDAO;
	}
	function getTypeEntiteDAO(){
		if($this->TypeEntiteDAO==null){

			$this->TypeEntiteDAO = new TypeEntiteDAO($this->pdo,$this);
		}
		return $this->TypeEntiteDAO;
	}
	function getTypeEntiteInfoDAO(){
		if($this->TypeEntiteInfoDAO==null){

			$this->TypeEntiteInfoDAO = new TypeEntiteInfoDAO($this->pdo,$this);
		}
		return $this->TypeEntiteInfoDAO;
	}
	function getUserDAO(){
		if($this->UserDAO==null){

			$this->UserDAO = new UserDAO($this->pdo,$this);
		}
		return $this->UserDAO;
	}
	function getListeDAO(){
		if($this->ListeDAO==null){

			$this->ListeDAO = new ListeDAO($this->pdo,$this);
		}
		return $this->ListeDAO;
	}
	function getListeValueDAO(){
		if($this->ListeValueDAO==null){

			$this->ListeValueDAO = new ListeValueDAO($this->pdo,$this);
		}
		return $this->ListeValueDAO;
	}
	function getEntiteDAO(){
		if($this->EntiteDAO==null){

			$this->EntiteDAO = new EntiteDAO($this->pdo,$this);
		}
		return $this->EntiteDAO;
	}
	function getProfileDAO(){
		if($this->ProfileDAO==null){

			$this->ProfileDAO = new ProfileDAO($this->pdo,$this);
		}
		return $this->ProfileDAO;
	}

	function getProprieteDAO(){
		if($this->ProprieteDAO==null){

			$this->ProprieteDAO = new ProprieteDAO($this->pdo,$this);
		}
		return $this->ProprieteDAO;
	}
	function getProprieteInfoDAO(){
		if($this->ProprieteInfoDAO==null){

			$this->ProprieteInfoDAO = new ProprieteInfoDAO($this->pdo,$this);
		}
		return $this->ProprieteInfoDAO;
	}
	function getProprieteValueDAO(){
		if($this->ProprieteValueDAO==null){

			$this->ProprieteValueDAO = new ProprieteValueDAO($this->pdo,$this);
		}
		return $this->ProprieteValueDAO;
	}
	function getTokenDAO(){
		if($this->TokenDAO==null){

			$this->TokenDAO = new TokenDAO($this->pdo,$this);
		}
		return $this->TokenDAO;
	}
	function getTokenPackDAO(){
		if($this->TokenPackDAO==null){

			$this->TokenPackDAO = new TokenPackDAO($this->pdo,$this);
		}
		return $this->TokenPackDAO;
	}
	function getLangueDAO(){
		if($this->LangueDAO==null){

			$this->LangueDAO = new LangueDAO($this->pdo,$this);
		}
		return $this->LangueDAO;
	}
	function getLangueLabelDAO(){
		if($this->LangueLabelDAO==null){

			$this->LangueLabelDAO = new LangueLabelDAO($this->pdo,$this);
		}
		return $this->LangueLabelDAO;
	}

	function getCategorieDAO(){
		if($this->CategorieDAO==null){

			$this->CategorieDAO = new CategorieDAO($this->pdo,$this);
		}
		return $this->CategorieDAO;
	}
	function getCategorieInfoDAO(){
		if($this->CategorieInfoDAO==null){

			$this->CategorieInfoDAO = new CategorieInfoDAO($this->pdo,$this);
		}
		return $this->CategorieInfoDAO;
	}
	function getDocumentDAO(){
		if($this->DocumentDAO==null){

			$this->DocumentDAO = new DocumentDAO($this->pdo,$this);
		}
		return $this->DocumentDAO;
	}
	function getDocumentInfoDAO(){
		if($this->DocumentInfoDAO==null){

			$this->DocumentInfoDAO = new DocumentInfoDAO($this->pdo,$this);
		}
		return $this->DocumentInfoDAO;
	}
	function getTranslationDAO(){
		if($this->TranslationDAO==null){

			$this->TranslationDAO = new TranslationDAO($this->pdo,$this);
		}
		return $this->TranslationDAO;
	}
}
?>
